def hailstone(n):
	seq = [n]
	while n>1:
		n = 3*n + 1 if n & 1 else n//2
  		seq.append(n)
	return seq

if __name__ == '__main__':
	for i in range(1, 999999):
		l = len(hailstone(i))
		if(l >= 325):
			print str(i)+" "+str(l) 
